-- GENERATED SPELL FOR [Elemental Slave] --


function spell0_2359(pUnit, Event) --@Cracking Stone,Self--
pUnit:FullCastSpellOnTarget(3671,pUnit)
pUnit:RegisterEvent('Sorts_2359', 601, 1)
end

function spell1_2359(pUnit, Event) --@Crumbling Stone,Self--
pUnit:FullCastSpellOnTarget(3672,pUnit)
pUnit:RegisterEvent('Sorts_2359', 595, 1)
end

function spell2_2359(pUnit, Event) --@Reduced to Rubble,Self--
pUnit:FullCastSpellOnTarget(3673,pUnit)
pUnit:RegisterEvent('Sorts_2359', 625, 1)
end

function Sorts_2359(pUnit, Event)
local choix_sorts_2359 = math.random(0, 2)
if choix_sorts_2359 == 0 then
pUnit:RegisterEvent('spell0_2359', 1, 1)
end
if choix_sorts_2359 == 1 then
pUnit:RegisterEvent('spell1_2359', 1, 1)
end
if choix_sorts_2359 == 2 then
pUnit:RegisterEvent('spell2_2359', 1, 1)
end
end

function mob2359_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2359', math.random(1500, 3000), 1)
end

function mob2359_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2359_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2359_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2359, 1, 'mob2359_Action')
RegisterUnitEvent(2359, 2, 'mob2359_Leave')
RegisterUnitEvent(2359, 3, 'mob2359_Kill')
RegisterUnitEvent(2359, 4, 'mob2359_Die')
